<div>
	<a style="float: left; width: 278px;color: white" href="<?php echo url_create('site', 'upload') ?>" class="buttons spaceBottom">
		<?php echo lang('upload_right') ?>
	</a>
	<div class="clear"></div>
</div>
<div class="box darkBox">
	<h3 class="topUsers">
		<?php echo lang('top_users') ?>
	</h3>
	<ul class="topUsersSort topUsersSortHome">
		<li><a class="selected" data-sort="week" href="#"><?php echo lang('week') ?></a> / </li>
		<li><a data-sort="month" href="#"><?php echo lang('month') ?></a> / </li>
		<li><a data-sort="all" href="#"><?php echo lang('all') ?></a> </li>
	</ul>
	<div class="clear"></div>
	<div id="topUserContent">
		<div class="topUsers">
			<?php foreach ($topUsers as $topUser) { ?>
				<div class="item">
					<a href="<?php echo url_create('site', 'account', 'images', $topUser->id) ?>">
						<img src="<?php echo fb_avatar($topUser->fb_id) ?>">
						<div class="info">
							<span class="name"><?php echo striplongstr($topUser->fullname) ?></span> <span class="likes"><?php echo $topUser->likes ?></span>
						</div>
					</a>
				</div>
			<?php } ?>
		</div>
		<div class="clear"></div>
		<div class="moreTop"><a href="<?php echo url_create('site', 'rankstats', 'index', 'week') ?>"><?php echo lang('view_more') ?> »</a></div>
	</div>
</div>
<div class="box darkBox socialBox">
    <h3><?php echo lang('social_label') ?></h3>
    <div class="media mimo">
        <div data-show-faces="false" data-width="270" data-send="false" data-href="<?php echo $social_page ?>" class="fb-like fb_edge_widget_with_comment fb_iframe_widget" fb-xfbml-state="rendered">
		</div>
    </div>
</div>
<div class="fixedScrollDetector" data-fixedtop="49"></div>
<div class="fixedScroll">
	<div id="footerRight">
		<ul class="links">

			<li><a href="#">Liên hệ</a>
			</li>
			<li>·<a href="#">FAQ</a>
			</li>
			<li>·<a target="_blank" href="<? echo $social_page ?>">Facebook</a>
			</li>
		</ul>
		<div class="clear">
		</div>
	</div>
</div>
<script>
	$('.topUsersSort a').live('click',function(){
		var a = $(this);
		$.ajax({
			url: '<?php echo url_create('site', 'rankstats', 'index') ?>/' + $(this).attr('data-sort'),
			dataType: 'json',
			success: function(o){
				if(o.state == 'success'){
					$('.topUsersSort a').removeClass('selected');
					a.addClass('selected');
					var inner='';
					for(var i in o.data){
						var user=o.data[i];
						inner+='<div class="item">'+
							'<a href="'+user.link+'">'+
							'<img src="'+user.avatar+'">'+
							'<div class="info">'+
							'<span class="name">'+user.fullname+'</span> <span class="likes">'+user.likes+'</span>'+
							'</div>'+
							'</a>'+
							'</div>';
					}
					$('#topUserContent .topUsers').html(inner);
					$('.moreTop a').attr('href','<?php echo url_create('site', 'rankstats', 'index') ?>/' + a.attr('data-sort'));
				}
			}
		})
	})
</script>